package com.mllweb.blog.service.impl;

import com.mllweb.blog.core.digest.Base64Utils;
import com.mllweb.blog.core.notice.email.Email;
import com.mllweb.blog.core.notice.email.template.ActivateTemplate;
import com.mllweb.blog.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmailNoticeServiceImpl implements NoticeService {
    @Autowired
    private Email email;

    @Override
    public void validate(String validateUser, String sign) {
        ActivateTemplate template=new ActivateTemplate();
        template.config("email", Base64Utils.encode(validateUser.getBytes()));
        template.config("sign", Base64Utils.encode(sign.getBytes()));
        email.send(validateUser,template);
    }
}
